<!DOCTYPE html>
<html lang="en" style="height: 100%">
<head>
    <meta charset="UTF-8">
    <title>HTML文档</title>
    <script>
        var dojoConfig = {
            parseOnLoad: false,
            async: true,
            cacheBust: false
        };
    </script>
    <script type="text/javascript" src="../common/dojo/dojo.js"></script>
    <script type="text/javascript">
        require(['./index.js'], function (index) {
            index();
        });
    </script>
    <link type="text/css" rel="stylesheet" href="./index.css">
</head>
<body id="indexBody" class="claro" style="height: 100%; margin: 0px">
<form action="save.php" target="saveWindow" method="post" onsubmit="openWindowWithName('saveWindow')"
      style="height: 100%">
    <div data-dojo-type="dijit/layout/BorderContainer" id="mainBorderLayout" style="height: 100%"
         data-dojo-props="persist:true">
        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
            <div style="display: inline-block;width: 25em">
                <input type="file" data-dojo-type="dojox/form/FileInput" id="fileInput"
                       data-dojo-props="label:'选择html文件', cancelText:'取消'">
            </div>
            <label for="encodingSelect">文件编码:</label>
            <select id="encodingSelect" required="required" name="charset">
                <option selected value="UTF-8">UTF8</option>
                <option value="GBK">GBK</option>
                <option value="ANSI">ANSI</option>
            </select>
            <button data-dojo-type="dijit/form/Button" onclick="loadDoc">加载</button>
            <input id="content" type="hidden" name="content"></input>
            <button type="submit" data-dojo-type="dijit/form/Button" onclick="saveDoc()">保存</button>
        </div>
        <div data-dojo-type="dijit/layout/ContentPane"
             data-dojo-props="region:'left', splitter:true"
             style="width: 15em">
            <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="gutters:false" style="height: 100%">
                <input id="docTitle" placeholder="文档标题" data-dojo-type="dijit/form/TextBox" style="width: 100%"
                       oninput="saveTitleToEditor" name="title" data-dojo-props="region:'top'">

                <div data-dojo-type="cbtree/Tree"
                     data-dojo-props="model:navigatorModel, showRoot:false, autoExpand:true, region:'center'"
                     onclick="navigatorClick"></div>
                <button data-dojo-type="dijit/form/Button" onclick="generateNav" data-dojo-props="region:'bottom'">
                    重新生成目录
                </button>
            </div>
        </div>
        <div id="editor" data-dojo-type="dijit/Editor" data-dojo-props="region:'center', extraPlugins:[
                'viewsource',
                'prettyprint',
                'createLink',
                'unlink',
                'insertImage',
                'formatBlock',
                'foreColor',
                'hiliteColor',
                'findreplace',
                'pastefromword',
                'preview'
            ]"></div>
    </div>
</form>
</body>
</html>